package com.feng.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


@Controller
public class UserController {
    @RequestMapping(value = "/user",method = RequestMethod.GET)
    public String getAllUer(){
        System.out.println("获取所有用户信息");
        return "success";
    }

    @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    public String getUserById(){
        System.out.println("获取单个用户信息");
        return "success";
    }

    @PostMapping("/user")
    public String insertUser(String name,String password){
        System.out.println("添加用户信息：\n用户名："+name+"\n密码："+password);
        return "success";
    }

    @PutMapping("/user")
    public String updateUser(String name,String password){
        System.out.println("修改用户信息：\n用户名："+name+"\n密码："+password);
        return "success";
    }
}
